package com.wangjw.test;

import java.lang.reflect.Field;

/**
 * Created by wangjw on 18/6/14.
 */
public class Student extends Person {

    private int score;

    public Student(String name, int age, int score) {
        super(name, age);
        this.score = score;
    }

    public int getScore() {
        return score;
    }

    public void setScore(int score) {
        this.score = score;
    }

    public static void main(String[] args) {
        Class cls = Student.class;

        Field[] fields = cls.getFields();
        for (Field field : fields) {
            System.out.println(field.getName());
        }

        System.out.println("========");
        fields = cls.getDeclaredFields();
        for (Field field: fields) {
            System.out.println(field.getName());
        }
    }
}
